package cn.itsource.article.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 文章类型表
 * @TableName tb_article_type
 */
@Data
public class ArticleType implements Serializable {
    /**
     * 主键ID
     */
    private Long id;

    /**
     * 文章类型名称
     */
    private String typeName;

    /**
     * 状态(0:不可用;1:可用)
     */
    private Integer status;

    /**
     * 添加时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime = new Date();

    /**
     * 修改时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;

    //类型计数
    private Integer num;

    /**
     * 上级Id
     */
    private Long parentId;

    /**
     * 上级对象
     */
    private ArticleType parent;

    //专门装儿子的集合
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<ArticleType> children = new ArrayList<>();



    private static final long serialVersionUID = 1L;
}